import { defineComponent, provide, nextTick } from 'vue'
import { RouterView } from 'vue-router'
import { cookies } from '@/utils/cookies'
import { useStore } from 'vuex'
import { modulesStore } from '@/store'

export default defineComponent({
  name: 'App',
  setup() {
    const token = cookies.get('token')
    if (token) {
      const store = useStore<modulesStore>()
      store.dispatch('user/getAccountInfo')
    }

    return () => (
      <RouterView/>
    )
  }
})